package edu.mit.media.fv.blocks
{
	import edu.mit.media.fv.fluidspace.FluidSpace;
	import edu.mit.media.fv.icons.AQClockIcon;

	public class ServiceModel extends UserModel
	{
		private static var ALL_MODELS:Array = new Array();
		public static function getServiceModels():Array{
			return ALL_MODELS;
		}
		private var activeBlockInstance:Block = null;
		private var groupBlockInstances:Block = null;
		public function ServiceModel(id:int, controller:FluidSpace, name:String)
		{
			super(id, controller, name);
			ALL_MODELS.push(this);
		}
		public override function getBlockInstance():Block{
			return new CircleBlock(this, this.controller, new AQClockIcon(), this.name, 0xB0F284);
		}
		public override function getActiveInstance():Block{
			if(this.activeBlockInstance == null){
				this.activeBlockInstance =  this.getBlockInstance();
			}
			this.activeBlockInstance.x = 0;
			this.activeBlockInstance.y = 0;
			return this.activeBlockInstance;
		}
		public override function getGroupInstance():Block{
			this.groupBlockInstances =this.getBlockInstance();
			this.groupBlockInstances.x = Math.random()*650;
			this.groupBlockInstances.y = Math.random()*400;
			return this.groupBlockInstances;
		}
	}
}